// 字体图标 url
const cssCdnUrlList = [window.location.origin + '/iconfont/iconfont.css']
// 第三方 js url
const jsCdnUrlList = []

// 动态设置字体图标
export function setCssCdn() {
  // 特殊路由，不需要加载字体图标
  if(window.location.href.indexOf('/s/') > -1 ) {
    return
  }
	if (cssCdnUrlList.length <= 0) return false
	cssCdnUrlList.map((v) => {
		let link = document.createElement('link')
		link.rel = 'stylesheet'
		link.href = v
		link.crossOrigin = 'anonymous'
    let head=document.getElementsByTagName('head')
		document.getElementsByTagName('head')[0].appendChild(link)
    let head1=document.getElementsByTagName('head')
	})
}

// 批量设置第三方js
export function setJsCdn() {
	if (jsCdnUrlList.length <= 0) return false
	jsCdnUrlList.map((v) => {
		let link = document.createElement('script')
		link.src = v
		document.body.appendChild(link)
	})
}

// 设置执行函数
const setIntroduction = {
	cssCdn: () => {
		setCssCdn()
	},
	jsCdn: () => {
		setJsCdn()
	}
}

// 导出函数方法
export default setIntroduction
